/****** Object:  Table [dbo].[be_Albums]    Script Date: 12/22/2007 14:16:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[be_Albums](
	[AlbumID] [uniqueidentifier] ROWGUIDCOL  NOT NULL CONSTRAINT [DF_be_Albums_AlbumID]  DEFAULT (newid()),
	[Title] [nvarchar](255) NULL,
	[Description] [nvarchar](max) NULL,
	[Slug] [nvarchar](255) NULL,
	[Author] [nvarchar](50) NULL,
	[DateCreated] [datetime] NULL,
	[DateModified] [datetime] NULL,
	[IsPublished] [bit] NULL,
	[IsCommentEnabled] [bit] NULL,
	[Raters] [int] NULL,
	[Rating] [real] NULL,
	[Order] [int] NULL,
	
 CONSTRAINT [PK_be_Albums] PRIMARY KEY CLUSTERED 
(
	[AlbumID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

/****** Object:  Table [dbo].[be_AlbumComment]    Script Date: 12/22/2007 14:17:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[be_AlbumComment](
	[AlbumCommentID] [uniqueidentifier] ROWGUIDCOL  NOT NULL CONSTRAINT [DF_be_AlbumComment_AlbumCommentID]  DEFAULT (newid()),
	[AlbumID] [uniqueidentifier] NOT NULL,
	[CommentDate] [datetime] NOT NULL,
	[Author] [nvarchar](255) NULL,
	[Email] [nvarchar](255) NULL,
	[Website] [nvarchar](255) NULL,
	[Comment] [nvarchar](max) NULL,
	[Country] [nvarchar](255) NULL,
	[Ip] [nvarchar](50) NULL,
	[IsApproved] [bit] NULL,
 CONSTRAINT [PK_be_AlbumComment] PRIMARY KEY CLUSTERED 
(
	[AlbumCommentID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[be_AlbumComment]  WITH CHECK ADD  CONSTRAINT [FK_be_AlbumComment_be_Albums] FOREIGN KEY([AlbumID])
REFERENCES [dbo].[be_Albums] ([AlbumID])
GO
ALTER TABLE [dbo].[be_AlbumComment] CHECK CONSTRAINT [FK_be_AlbumComment_be_Albums]
GO

/****** Object:  Table [dbo].[be_AlbumTag]    Script Date: 12/22/2007 14:17:44 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[be_AlbumTag](
	[AlbumTagID] [int] IDENTITY(1,1) NOT NULL,
	[AlbumID] [uniqueidentifier] NOT NULL,
	[Tag] [nvarchar](50) NULL,
 CONSTRAINT [PK_be_AlbumTag] PRIMARY KEY CLUSTERED 
(
	[AlbumTagID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
ALTER TABLE [dbo].[be_AlbumTag]  WITH CHECK ADD  CONSTRAINT [FK_be_AlbumTag_be_Albums] FOREIGN KEY([AlbumID])
REFERENCES [dbo].[be_Albums] ([AlbumID])
GO
/****** Object:  Table [dbo].[be_Photos]    Script Date: 12/22/2007 14:16:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[be_Photos](
	[PhotoID] [uniqueidentifier] ROWGUIDCOL  NOT NULL CONSTRAINT [DF_be_Photos_PhotoID]  DEFAULT (newid()),
	[Title] [nvarchar](255) NULL,
	[Description] [nvarchar](max) NULL,
	[Content] [ntext] NULL,
	[DateCreated] [datetime] NULL,
	[DateModified] [datetime] NULL,
	[Author] [nvarchar](50) NULL,
	[IsPublished] [bit] NULL,
	[IsCommentEnabled] [bit] NULL,
	[Raters] [int] NULL,
	[Rating] [real] NULL,
	[Slug] [nvarchar](255) NULL,
	[Location] [nvarchar](max) NULL,
	[PhotoDate] [datetime] NULL,
	[Order] [int] NULL,
	[Width] [int] NULL,
	[Height] [int] NULL,
	[FileSize] [int] NULL,
	[MD5Hash] [nvarchar](255) NULL,
	[AlbumID] [uniqueidentifier]  NULL,
 CONSTRAINT [PK_be_Photos] PRIMARY KEY CLUSTERED 
(
	[PhotoID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[be_PhotoCategory]    Script Date: 12/22/2007 14:17:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[be_PhotoCategory](
	[PhotoCategoryID] [int] IDENTITY(1,1) NOT NULL,
	[PhotoID] [uniqueidentifier] NOT NULL,
	[CategoryID] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_be_PhotoCategory] PRIMARY KEY CLUSTERED 
(
	[PhotoCategoryID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
ALTER TABLE [dbo].[be_PhotoCategory]  WITH CHECK ADD  CONSTRAINT [FK_be_PhotoCategory_be_Categories] FOREIGN KEY([CategoryID])
REFERENCES [dbo].[be_Categories] ([CategoryID])
GO
ALTER TABLE [dbo].[be_PhotoCategory] CHECK CONSTRAINT [FK_be_PhotoCategory_be_Categories]
GO
ALTER TABLE [dbo].[be_PhotoCategory]  WITH CHECK ADD  CONSTRAINT [FK_be_PhotoCategory_be_Photos] FOREIGN KEY([PhotoID])
REFERENCES [dbo].[be_Photos] ([PhotoID])
GO
ALTER TABLE [dbo].[be_PhotoCategory] CHECK CONSTRAINT [FK_be_PhotoCategory_be_Photos]
GO
/****** Object:  Table [dbo].[be_PhotoComment]    Script Date: 12/22/2007 14:17:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[be_PhotoComment](
	[PhotoCommentID] [uniqueidentifier] ROWGUIDCOL  NOT NULL CONSTRAINT [DF_be_PhotoComment_PhotoCommentID]  DEFAULT (newid()),
	[PhotoID] [uniqueidentifier] NOT NULL,
	[CommentDate] [datetime] NOT NULL,
	[Author] [nvarchar](255) NULL,
	[Email] [nvarchar](255) NULL,
	[Website] [nvarchar](255) NULL,
	[Comment] [nvarchar](max) NULL,
	[Country] [nvarchar](255) NULL,
	[Ip] [nvarchar](50) NULL,
	[IsApproved] [bit] NULL,
 CONSTRAINT [PK_be_PhotoComment] PRIMARY KEY CLUSTERED 
(
	[PhotoCommentID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
ALTER TABLE [dbo].[be_PhotoComment]  WITH CHECK ADD  CONSTRAINT [FK_be_PhotoComment_be_Photos] FOREIGN KEY([PhotoID])
REFERENCES [dbo].[be_Photos] ([PhotoID])
GO
ALTER TABLE [dbo].[be_PhotoComment] CHECK CONSTRAINT [FK_be_PhotoComment_be_Photos]
GO
/****** Object:  Table [dbo].[be_PhotoNotify]    Script Date: 12/22/2007 14:17:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[be_PhotoNotify](
	[PhotoNotifyID] [int] IDENTITY(1,1) NOT NULL,
	[PhotoID] [uniqueidentifier] NOT NULL,
	[NotifyAddress] [nvarchar](255) NULL,
 CONSTRAINT [PK_be_PhotoNotify] PRIMARY KEY CLUSTERED 
(
	[PhotoNotifyID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
ALTER TABLE [dbo].[be_PhotoNotify]  WITH CHECK ADD  CONSTRAINT [FK_be_PhotoNotify_be_Photos] FOREIGN KEY([PhotoID])
REFERENCES [dbo].[be_Photos] ([PhotoID])
GO
ALTER TABLE [dbo].[be_PhotoNotify] CHECK CONSTRAINT [FK_be_PhotoNotify_be_Photos]
GO
/****** Object:  Table [dbo].[be_PhotoTag]    Script Date: 12/22/2007 14:17:44 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[be_PhotoTag](
	[PhotoTagID] [int] IDENTITY(1,1) NOT NULL,
	[PhotoID] [uniqueidentifier] NOT NULL,
	[Tag] [nvarchar](50) NULL,
 CONSTRAINT [PK_be_PhotoTag] PRIMARY KEY CLUSTERED 
(
	[PhotoTagID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
ALTER TABLE [dbo].[be_PhotoTag]  WITH CHECK ADD  CONSTRAINT [FK_be_PhotoTag_be_Photos] FOREIGN KEY([PhotoID])
REFERENCES [dbo].[be_Photos] ([PhotoID])
GO
ALTER TABLE [dbo].[be_PhotoTag] CHECK CONSTRAINT [FK_be_PhotoTag_be_Photos]
GO
/****** Object:  Index [FK_PhotoID]    Script Date: 12/22/2007 14:18:36 ******/
CREATE NONCLUSTERED INDEX [FK_PhotoID] ON [dbo].[be_PhotoCategory] 
(
	[PhotoID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[be_Links]    Script Date: 12/22/2007 14:16:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[be_Links](
	[LinkID] [uniqueidentifier] ROWGUIDCOL  NOT NULL CONSTRAINT [DF_be_Links_LinkID]  DEFAULT (newid()),
	[Title] [nvarchar](255) NULL,
	[Description] [nvarchar](max) NULL,
	[WebSite] [nvarchar](max) NULL,
	[Feed] [nvarchar](max) NULL,
	[XFNTag] [nvarchar](max) NULL,
	[Image] [image] NULL,
	[Blogroll] [nvarchar](max) NULL,
	[IsPublished] [bit] NULL,
	[Order] [int] NULL,
	[Slug] [nvarchar](255) NULL,
 CONSTRAINT [PK_be_Links] PRIMARY KEY CLUSTERED 
(
	[LinkID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[be_PhotoEffects]    Script Date: 12/22/2007 14:16:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[be_PhotoEffects](
	[PhotoEffectID] [uniqueidentifier] ROWGUIDCOL  NOT NULL CONSTRAINT [DF_be_PhotoEffects_PhotoEffectID]  DEFAULT (newid()),
	[Title] [nvarchar](255) NULL,
	[Effect] [nvarchar](255) NULL,
	[DateModified] [datetime] NULL,
 CONSTRAINT [PK_be_PhotoEffects] PRIMARY KEY CLUSTERED 
(
	[PhotoEffectID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] 
GO
USE [BlogEngine]
GO
/****** Object:  Table [dbo].[be_PhotoEffectParameters]    Script Date: 12/23/2007 13:16:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[be_PhotoEffectParameters](
	[PhotoPhotoEffectsID] [int] IDENTITY(1,1) NOT NULL,
	[PhotoEffectID] [uniqueidentifier] NOT NULL,
	[Parameter] [nvarchar](255) NOT NULL,
	[Value] [nvarchar](255) NULL
 CONSTRAINT [PK_be_PhotoEffectTag] PRIMARY KEY CLUSTERED 
(
	[PhotoEffectID], [Parameter] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
ALTER TABLE [dbo].[be_PhotoEffectParameters]  WITH CHECK ADD  CONSTRAINT [FK_be_PhotoEffectParameters_be_PhotoEffects] FOREIGN KEY([PhotoEffectID])
REFERENCES [dbo].[be_PhotoEffects] ([PhotoEffectID])
GO
ALTER TABLE [dbo].[be_PhotoEffectParameters] CHECK CONSTRAINT [FK_be_PhotoEffectParameters_be_PhotoEffects]
GO
USE [BlogEngine]
GO
/****** Object:  Table [dbo].[be_PhotoPhotoEffect]    Script Date: 12/23/2007 14:06:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[be_PhotoPhotoEffect](
	[PhotoPhotoEffectsID] [int] IDENTITY(1,1) NOT NULL,
	[PhotoID] [uniqueidentifier] NOT NULL,
	[PhotoEffectID] [uniqueidentifier] NOT NULL,
	[Order] [int] NULL,
 CONSTRAINT [PK_be_PhotoPhotoEffects] PRIMARY KEY CLUSTERED 
(
	[PhotoPhotoEffectsID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
ALTER TABLE [dbo].[be_PhotoPhotoEffect]  WITH CHECK ADD  CONSTRAINT [FK_be_PhotoPhotoEffects_be_PhotoEffects] FOREIGN KEY([PhotoEffectID])
REFERENCES [dbo].[be_PhotoEffects] ([PhotoEffectID])
GO
ALTER TABLE [dbo].[be_PhotoPhotoEffect] CHECK CONSTRAINT [FK_be_PhotoPhotoEffects_be_PhotoEffects]
GO
ALTER TABLE [dbo].[be_PhotoPhotoEffect]  WITH CHECK ADD  CONSTRAINT [FK_be_PhotoPhotoEffects_be_Photos] FOREIGN KEY([PhotoID])
REFERENCES [dbo].[be_Photos] ([PhotoID])
GO
ALTER TABLE [dbo].[be_PhotoPhotoEffect] CHECK CONSTRAINT [FK_be_PhotoPhotoEffects_be_Photos]
GO
/****** Object:  Table [dbo].[be_PhotoFiles]    Script Date: 12/26/2007 17:42:38 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[be_PhotoFiles](
	[PhotoID] [uniqueidentifier] ROWGUIDCOL  NOT NULL CONSTRAINT [DF_be_PhotoFiles_PhotoID]  DEFAULT (newid()),
	[PhotoFile] [varbinary](max) NULL,
 CONSTRAINT [PK_be_PhotoFiles] PRIMARY KEY CLUSTERED 
(
	[PhotoID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
INSERT INTO be_Settings (SettingName, SettingValue)	VALUES ('albumcolumns', '3');
INSERT INTO be_Settings (SettingName, SettingValue)	VALUES ('albumrows', '4');
INSERT INTO be_Settings (SettingName, SettingValue)	VALUES ('albumthumbnailsize', '250');
INSERT INTO be_Settings (SettingName, SettingValue)	VALUES ('gallerythumbnailsize', '250');
INSERT INTO be_Settings (SettingName, SettingValue)	VALUES ('gallerycolumns', '3');
INSERT INTO be_Settings (SettingName, SettingValue)	VALUES ('galleryrows', '4');


